#pragma once
#include <stdlib.h>
#include <stdint.h>
#include <stdbool.h>

#define MAX_QUEUE_SIZE (1 << 16)
#define MAX_QUEUE_LENGTH (MAX_QUEUE_SIZE - 1)

typedef struct circle_queue_s {
    uint16_t front;
    uint16_t rear;
    uint32_t size;

    size_t element_size;
    void *queue;
} circle_queue_t;


circle_queue_t *CircleQueue_NewQueue(const size_t element_size);

void CircleQueue_Destroy(circle_queue_t *cir_queue);

void *CircleQueue_Dequeue(circle_queue_t *cir_queue);

bool CircleQueue_Enqueue(circle_queue_t *cir_queue, void *element);

void *CircleQueue_GetUpdatedHead(circle_queue_t *cir_queue);
